# -*- coding: utf-8 -*-
""" 
@author: ertao.xyz
@create: 2021-09-07 15:05
@description: 
"""
from pydantic import BaseModel, Field
from typing import List, Dict, Optional

from .model import MenuBase, MenuType


class MenuCreate(MenuBase):
    type: MenuType = Field(..., description='菜单名称', max_length=32)
    name: str = Field(..., description='菜单名称', max_length=32)
    title: str = Field(None, description='标题', max_length=32)
    parent_id: int = Field(None, description='上级菜单')
    orderNo: int = Field(1, description='排序')
    icon: str = Field(None, description='图标', max_length=32)
    path: str = Field(None, description='路径地址', max_length=128)
    component: str = Field(None, description='组件路径', max_length=128)
    permission: str = Field(None, description='权限标识', max_length=64)
    redirect: str = Field(None, description='重定向', max_length=128)
    isExt: bool = Field(False, description='是否外链')
    show: bool = Field(True, description='是否显示')
    routerMeta: str = Field(None, description='Meta 配置')
    status: bool = Field(True, description='状态')


class MenuOut(MenuCreate):
    id: int


class Ids(BaseModel):
    ids: List[int]
